package com.zhang.gmall.app.func;

import com.zhang.gmall.utils.KeyWordUtil;
import org.apache.flink.api.java.tuple.Tuple2;
import org.apache.flink.table.functions.TableFunction;
import org.apache.flink.types.Row;

import java.io.IOException;
import java.util.List;

/**
 * @title:
 * @author: zhang
 * @date: 2022/3/26 22:17
 */
public class SplitWordFunc extends TableFunction<String> {
    public void eval(String str){
        List<String> list;

            try {
                list = KeyWordUtil.splitKeyWord(str);
                for (String word : list) {
                    collect(word);
                }
            } catch (IOException e) {
                collect(str);
            }
    }
}
